# 国际化支持模块

# 语言资源字典
language_resources = {
    "zh": {
        # 通用文本
        "app_title": "LiberTool - 个人工具箱",
        "app_description": "高效工具集成平台",
        "back_to_home": "返回首页",
        "back": "返回",
        "search_placeholder": "搜索工具...",
        "welcome_title": "欢迎使用 LiberTool 工具箱",
        "welcome_text": "这是一个高效工具集成平台，提供多种实用工具，包括 JSON 格式化、HTTP 请求测试、时间戳转换等。",
        "copyright": "© 2023 LiberTool - 个人工具箱",
        "use_tool": "使用工具",
        "view_doc": "查看文档",
        
        # 通用按钮和操作
        "copy": "复制",
        "clear": "清空",
        "convert": "转换",
        "result": "结果",
        "search": "搜索",
        "loading": "加载中...",
        "download": "下载",
        "generate": "生成",
        "preview": "预览",
        
        # 工具分类
        "category_all": "全部工具",
        "category_common": "常用工具",
        "category_encoding": "编码加密",
        "category_network": "网络工具",
        "category_datetime": "时间日期",
        "category_text": "文本处理",
        "category_image": "图像工具",
        "category_photography": "摄影工具",
        "category_video": "视频工具",
        "category_documentation": "说明书",
        "category_pdf_edit": "PDF编辑",
        
        # 工具名称
        "tool_time_converter": "时间戳转换",
        "tool_encoding_converter": "编码转换工具",
        "tool_qrcode_generator": "二维码生成",
        "tool_ico_generator": "ICO图标生成",
        "tool_color_picker": "颜色选择器",
        "tool_markdown_editor": "Markdown编辑器",
        "tool_photo_param_calculator": "摄影参数计算器",
        "tool_timelapse_calculator": "延迟摄影计算器",
        "tool_weather_checker": "摄影天气查看",
        "tool_video_downloader": "网页视频下载",
        "tool_document_search": "文档搜索",
        "tool_pdf_editor": "PDF编辑器",
        
        # 工具描述
        "desc_time_converter": "Unix时间戳与日期时间的互转换工具",
        "desc_encoding_converter": "Base64/URL/Unicode编码转换工具",
        "desc_qrcode_generator": "文本/URL转二维码图片工具",
        "desc_ico_generator": "将PNG/JPG/SVG图片转换为ICO图标文件",
        "desc_color_picker": "多种颜色编码格式转换与色板选择工具",
        "desc_markdown_editor": "在线Markdown文档编辑与实时预览工具",
        "desc_photo_param_calculator": "计算光圈、快门速度、ISO等摄影参数的工具",
        "desc_timelapse_calculator": "计算延迟摄影所需的拍摄间隔和照片数量",
        "desc_weather_checker": "查看拍摄地点的天气情况，帮助规划拍摄时间",
        "desc_video_downloader": "从主流网站下载视频文件",
        "desc_document_search": "搜索和上传说明书文档",
        "desc_pdf_editor": "编辑PDF文件",

        # Stirling PDF 跳转页面
        "stirling_pdf_redirect_message_title": "正在为您跳转到 Stirling PDF 工具集...",
        "stirling_pdf_redirect_message_manual_link": "如果浏览器没有自动跳转，请点击下面的按钮。",
        "stirling_pdf_redirect_manual_button": "手动打开 Stirling PDF",

        "annotate_tab_label": "注释",
        "edit_tab_label": "编辑",
        "font_family": "字体",
        "bold": "加粗",
        "italic": "斜体",
        "underline": "下划线",
        "font_color": "字体颜色",
        "bg_color": "背景颜色",
        "align": "对齐",
        "align_left": "左对齐",
        "align_center": "居中对齐",
        "align_right": "右对齐",
        "opacity": "不透明度",
        "apply_add_text": "应用文本",
        "draw": "书写",
        "pen_color": "画笔颜色",
        "pen_width": "画笔宽度",
        "activate_draw_mode": "启用书写模式",
        "shapes": "形状",
        "shape_type": "形状类型",
        "shape_line": "直线",
        "shape_rectangle": "矩形",
        "shape_circle": "圆形",
        "shape_symbol": "符号",
        "shape_bg_color": "背景颜色",
        "shape_border_color": "边框颜色",
        "shape_border_width": "边框宽度",
        "shape_border_radius": "圆角半径",
        "shape_opacity": "形状不透明度",
        "shape_rotation": "旋转",
        "apply_add_shape": "应用形状",
        "edit_text_content": "编辑文本内容",
        "edit_image_content": "编辑图片内容",
        "page_thumbnails": "页面缩略图",
        "fit_width": "适应宽度",
        "display_single_page": "单页显示",
        "display_double_page": "双页显示",
        "display_cover_page": "封面显示",
        "history_panel_title": "操作历史",
        "edit_history_item": "编辑此项",
        "delete_history_item": "删除此项",
        "no_history_items": "暂无操作记录",
        "export_pdf": "导出PDF",
        
        # PDF 编辑器 UI - 新增
        "select_pdf_file": "选择PDF文件",
        "drag_drop_pdf": "或拖放文件至此处",
        "upload_pdf": "上传PDF文件",
        "no_pdf_uploaded": "尚未上传PDF文件。请选择一个文件开始编辑。",
        "upload_your_pdf_title": "上传您的PDF文件",
        "upload_standard_instruction": "请选择一个PDF文件开始编辑",
        "or_text": "或者",
        "upload_instruction_note": "您可以点击上方的文件选择框选择文件",
        "drag_drop_pdf_note": "或直接将PDF文件拖放到此区域",
        "reupload_pdf": "重新上传PDF",
        
        # PDF 编辑器 UI
        "previous_page": "上一页",
        "next_page": "下一页",
        "page": "页码",
        "editing_tools": "编辑工具",
        "add_text": "添加文本",
        "enter_text_here": "在此输入文本",
        "font_size": "字号:",
        "color": "颜色:",
        "add_image": "添加图片",
        "draw_rectangle": "绘制矩形",
        "draw_line": "绘制线条",
        "shape_line_color": "形状/线条颜色:",
        "line_width": "线宽:",
        "save_pdf": "保存PDF",
        "pdf_placeholder": "请先上传一个PDF文件",

        # 时间戳转换工具
        "current_timestamp": "当前时间戳",
        "seconds": "秒",
        "milliseconds": "毫秒",
        "toggle_unit": "切换单位",
        "copy": "复制",
        "pause": "暂停",
        "resume": "继续",
        "timestamp_to_date": "时间戳转日期时间",
        "date_to_timestamp": "日期时间转时间戳",
        "timestamp": "时间戳",
        "enter_timestamp": "请输入时间戳",
        "timestamp_type": "时间戳类型",
        "timezone": "时区",
        "convert": "转换",
        "datetime": "日期时间",
        "result": "结果",
        
        # 编码转换工具
        "encode": "编码",
        "decode": "解码",
        "input_text": "输入文本",
        "load_example": "加载示例",
        "clear": "清空",
        "input_placeholder": "输入要处理的内容...",
        "encoding_result": "编码结果",
        "copy_result": "复制结果",
        "result_placeholder": "结果将在这里显示...",
        "base64_description_title": "Base64编码说明",
        "base64_description_content": "Base64是一种基于64个可打印字符来表示二进制数据的表示方法，常用于HTTP环境下传输二进制数据，如图片或其他媒体文件。",
        
        # 二维码生成器
        "basic_settings": "基本设置",
        "qr_content": "二维码内容",
        "size_pixels": "尺寸 (像素)",
        "margin_pixels": "边距 (像素)",
        "dot_style": "点样式",
        "square": "方块",
        "round": "圆点",
        "color_settings": "颜色设置",
        "background_color": "背景颜色",
        "foreground_color": "前景颜色",
        "eye_color": "眼睛颜色",
        "eye_radius": "眼睛圆角",
        "preset_colors": "预设颜色",
        "preset_classic": "经典黑白",
        "preset_business": "商务蓝",
        "preset_red": "活力红",
        "preset_green": "清新绿",
        "preset_tech": "科技蓝",
        
        # ICO图标生成器
        "basic_settings": "基本设置",
        "upload_image": "上传图片",
        "remove": "移除",
        "supported_formats": "支持PNG、JPG和SVG格式",
        "image_preview": "图片预览",
        "icon_size": "图标尺寸 (像素)",
        "common_sizes": "常用尺寸: 16, 32, 48, 64, 128, 256, 512像素",
        "corner_radius": "圆角率 (%)",
        "preset_sizes": "预设尺寸",
        "preset_corners": "预设圆角",
        "no_corner": "无圆角",
        "slight_corner": "轻微圆角",
        "rounded_corner": "圆润圆角",
        "circle": "圆形",
        "generate_icon": "生成图标",
        "download_icon": "下载图标",
        "icon_preview": "图标预览",
        "please_upload": "请先上传图片",
        "generating": "生成中...",
        
        # 颜色选择器
        "color_picker": "颜色选择器",
        "select_color": "选择颜色：",
        "color_preview": "颜色预览",
        "complementary_color": "互补色",
        "color_palette": "颜色调色板",
        "monochromatic": "单色",
        "analogous": "类似色",
        "triadic": "三色",
        "tetradic": "四色",
        
        # 摄影参数计算器
        "exposure_calculator": "曝光值计算",
        "aperture": "光圈值 (f/)",
        "shutter_speed": "快门速度 (秒)",
        "iso": "ISO感光度",
        "calculate_ev": "计算曝光值",
        "exposure_value": "曝光值 (EV):",
        "dof_calculator": "景深计算器",
        "focal_length": "焦距 (mm)",
        "focus_distance": "对焦距离 (m)",
        "sensor_size": "传感器尺寸",
        "calculate_dof": "计算景深",
        "dof_result": "景深计算结果",
        "near_limit": "近端限制:",
        "far_limit": "远端限制:",
        "total_dof": "总景深:",
        "hyperfocal": "超焦距离:",
        
        # 延迟摄影计算器
        "timelapse_calculator": "延迟摄影计算器",
        "real_duration": "实际事件总时长",
        "hours": "小时",
        "minutes": "分钟",
        "real_duration_desc": "您计划拍摄的实际时间长度",
        "video_duration": "最终视频时长（秒）",
        "video_duration_desc": "最终延迟摄影视频的播放时长",
        "fps": "视频帧率（FPS）",
        "fps_desc": "最终视频的每秒帧数",
        "calculate_params": "计算参数",
        "calculation_result": "计算结果",
        "total_frames": "需要拍摄照片数量:",
        "interval_seconds": "拍摄间隔:",
        "camera_settings": "建议相机设置:",
        "timelapse_tips": "延迟摄影拍摄技巧",
        "stability": "稳定性",
        "stability_desc": "使用坚固的三脚架，避免任何相机移动",
        "battery": "电池续航",
        "battery_desc": "长时间拍摄建议使用外接电源或备用电池",
        "storage": "存储空间",
        "storage_desc": "确保有足够的存储卡空间存储所有照片",
        "manual_settings": "手动设置",
        "manual_settings_desc": "使用手动模式(M)拍摄；固定光圈、快门、ISO（或ISO自动），避免曝光闪烁",
        "aperture_priority": "光圈优先",
        "aperture_priority_desc": "光圈优先（A档）拍摄；自动ISO：适合光线变化平缓的场景（如白天到傍晚）",
        "focus": "对焦",
        "focus_desc": "使用手动对焦，避免自动对焦在拍摄过程中变化",
        "common_subjects": "常见主题建议间隔",
        "subject": "拍摄主题",
        "suggested_interval": "建议间隔",
        "clouds": "云朵移动",
        "crowd": "人群流动",
        "sunrise": "日出/日落",
        "stars": "星空轨迹",
        "flowers": "花朵绽放",
        
        # 摄影天气查看
        "check_location_weather": "查询地点天气",
        "location": "地点",
        "search": "搜索",
        "use_current_location": "使用当前位置",
        "location_example": "例如：北京、上海、广州",
        "date": "日期",
        "check_weather": "查询天气",
        "photo_suggestions": "摄影建议",
        "loading": "加载中...",
        "getting_weather": "正在获取天气数据...",
        "sunrise_time": "日出时间",
        "sunset_time": "日落时间",
        "wind_speed": "风速",
        "humidity": "湿度",
        "golden_hour": "黄金时刻",
        "morning": "早晨",
        "evening": "傍晚",
        "blue_hour": "蓝调时刻",
        "weather_forecast": "天气预报",
        "hourly_forecast": "每小时预报",
        "time": "时间",
        "temp": "温度",
        "conditions": "天气状况",
        "morning_golden_hour": "早晨黄金时刻",
        "evening_golden_hour": "傍晚黄金时刻",
        "to": "至",
        "weather_data_error": "获取天气数据失败，请检查网络连接或稍后重试。",
        "future_weather_forecast": "未来天气预报",
        "check_weather_first": "请先查询天气获取预报信息",
        
        # 语言切换
        "language": "语言",
        "language_zh": "中文",
        "language_en": "English"
    },
    "en": {
        # 通用文本
        "app_title": "LiberTool - Personal Toolbox",
        "app_description": "Efficient Tool Integration Platform",
        "back_to_home": "Back to Home",
        "back": "Back",
        "search_placeholder": "Search tools...",
        "welcome_title": "Welcome to LiberTool Toolbox",
        "welcome_text": "This is an efficient tool integration platform, providing various practical tools, including JSON formatting, HTTP request testing, timestamp conversion, etc.",
        "copyright": "© 2023 LiberTool - Personal Toolbox",
        "use_tool": "Use Tool",
        "view_doc": "View Document",
        
        # 工具分类
        "category_all": "All Tools",
        "category_common": "Common Tools",
        "category_encoding": "Encoding & Encryption",
        "category_network": "Network Tools",
        "category_datetime": "Date & Time",
        "category_text": "Text Processing",
        "category_image": "Image Tools",
        "category_photography": "Photography Tools",
        "category_video": "Video Tools",
        "category_documentation": "Documentation",
        "category_pdf_edit": "PDF Edit",
        
        # 工具名称
        "tool_time_converter": "Timestamp Converter",
        "tool_encoding_converter": "Encoding Converter",
        "tool_qrcode_generator": "QR Code Generator",
        "tool_ico_generator": "ICO Icon Generator",
        "tool_color_picker": "Color Picker",
        "tool_markdown_editor": "Markdown Editor",
        "tool_photo_param_calculator": "Photography Parameter Calculator",
        "tool_timelapse_calculator": "Timelapse Calculator",
        "tool_weather_checker": "Photography Weather Checker",
        "tool_video_downloader": "Web Video Downloader",
        "tool_document_search": "Document Search",
        "tool_pdf_editor": "PDF Editor",
        
        # 工具描述
        "desc_time_converter": "Unix timestamp and datetime conversion tool",
        "desc_encoding_converter": "Base64/URL/Unicode encoding conversion tool",
        "desc_qrcode_generator": "Text/URL to QR code image tool",
        "desc_ico_generator": "Convert PNG/JPG/SVG images to ICO icon files",
        "desc_color_picker": "Multiple color code format conversion and palette selection tool",
        "desc_markdown_editor": "Online Markdown document editing and real-time preview tool",
        "desc_photo_param_calculator": "Tool for calculating aperture, shutter speed, ISO and other photography parameters",
        "desc_timelapse_calculator": "Calculate shooting intervals and number of photos needed for timelapse",
        "desc_weather_checker": "Check weather conditions at shooting locations to help plan shooting times",
        "desc_video_downloader": "Download video files from mainstream websites",
        "desc_document_search": "Search and upload instruction manual documents",
        "desc_pdf_editor": "Edit PDF files",

        # PDF Editor UI - Upload Section (English)
        "upload_your_pdf_title": "Upload Your PDF",
        "upload_standard_instruction": "Select a PDF file to start editing",
        "or_text": "OR",
        "upload_instruction_note": "You can use the file input above",
        "drag_drop_pdf_note": "or drag and drop a PDF file here",
        "no_pdf_uploaded": "No PDF file uploaded. Please select a file to start editing.",
        "reupload_pdf": "Re-upload PDF",
        
        "annotate_tab_label": "Annotate",
        "edit_tab_label": "Edit",
        "font_family": "Font",
        "bold": "Bold",
        "italic": "Italic",
        "underline": "Underline",
        "font_color": "Font Color",
        "bg_color": "Background Color",
        "align": "Align",
        "align_left": "Align Left",
        "align_center": "Align Center",
        "align_right": "Align Right",
        "opacity": "Opacity",
        "apply_add_text": "Add Text",
        "draw": "Draw",
        "pen_color": "Pen Color",
        "pen_width": "Pen Width",
        "activate_draw_mode": "Activate Draw Mode",
        "shapes": "Shapes",
        "shape_type": "Type",
        "shape_line": "Line",
        "shape_rectangle": "Rectangle",
        "shape_circle": "Circle",
        "shape_symbol": "Symbol",
        "shape_bg_color": "Background Color",
        "shape_border_color": "Border Color",
        "shape_border_width": "Border Width",
        "shape_border_radius": "Border Radius",
        "shape_opacity": "Opacity",
        "shape_rotation": "Rotation",
        "apply_add_shape": "Add Shape",
        "edit_text_content": "Edit Text Content",
        "edit_image_content": "Edit Image Content",
        "page_thumbnails": "Page Thumbnails",
        "fit_width": "Fit Width",
        "display_single_page": "Single Page",
        "display_double_page": "Double Page",
        "display_cover_page": "Cover Page",
        "history_panel_title": "History",
        "edit_history_item": "Edit Item",
        "delete_history_item": "Delete Item",
        "no_history_items": "No history items yet.",
        "export_pdf": "Export PDF",
        
        # PDF Editor UI (English)
        "previous_page": "Previous Page",
        "next_page": "Next Page",
        "page": "Page",
        "editing_tools": "Editing Tools",
        "add_text": "Add Text",
        "enter_text_here": "Enter text here",
        "font_size": "Font Size:",
        "color": "Color:",
        "add_image": "Add Image",
        "draw_rectangle": "Draw Rectangle",
        "draw_line": "Draw Line",
        "shape_line_color": "Shape/Line Color:",
        "line_width": "Line Width:",
        "save_pdf": "Save PDF",

        # Time Converter Tool
        "current_timestamp": "Current Timestamp",
        "seconds": "Seconds",
        "milliseconds": "Milliseconds",
        "toggle_unit": "Toggle Unit",
        "copy": "Copy",
        "pause": "Pause",
        "resume": "Resume",
        "timestamp_to_date": "Timestamp to Date",
        "date_to_timestamp": "Date to Timestamp",
        "timestamp": "Timestamp",
        "enter_timestamp": "Please enter timestamp",
        "timestamp_type": "Timestamp Type",
        "timezone": "Timezone",
        "convert": "Convert",
        "datetime": "Datetime",
        "result": "Result",
        
        # 编码转换工具
        "encode": "Encode",
        "decode": "Decode",
        "input_text": "Input Text",
        "load_example": "Load Example",
        "clear": "Clear",
        "input_placeholder": "Enter content to process...",
        "encoding_result": "Encoding Result",
        "copy_result": "Copy Result",
        "result_placeholder": "Results will be displayed here...",
        "base64_description_title": "Base64 Encoding Description",
        "base64_description_content": "Base64 is a method of representing binary data based on 64 printable characters, commonly used for transmitting binary data in HTTP environments, such as images or other media files.",
        
        # 二维码生成器
        "basic_settings": "Basic Settings",
        "qr_content": "QR Code Content",
        "size_pixels": "Size (pixels)",
        "margin_pixels": "Margin (pixels)",
        "dot_style": "Dot Style",
        "square": "Square",
        "round": "Round",
        "color_settings": "Color Settings",
        "background_color": "Background Color",
        "foreground_color": "Foreground Color",
        "eye_color": "Eye Color",
        "eye_radius": "Eye Radius",
        "preset_colors": "Preset Colors",
        "preset_classic": "Classic Black & White",
        "preset_business": "Business Blue",
        "preset_red": "Vibrant Red",
        "preset_green": "Fresh Green",
        "preset_tech": "Tech Blue",
        
        # ICO图标生成器
        "basic_settings": "Basic Settings",
        "upload_image": "Upload Image",
        "remove": "Remove",
        "supported_formats": "Supports PNG, JPG and SVG formats",
        "image_preview": "Image Preview",
        "icon_size": "Icon Size (pixels)",
        "common_sizes": "Common sizes: 16, 32, 48, 64, 128, 256, 512 pixels",
        "corner_radius": "Corner Radius (%)",
        "preset_sizes": "Preset Sizes",
        "preset_corners": "Preset Corners",
        "no_corner": "No Corner",
        "slight_corner": "Slight Corner",
        "rounded_corner": "Rounded Corner",
        "circle": "Circle",
        "generate_icon": "Generate Icon",
        "download_icon": "Download Icon",
        "icon_preview": "Icon Preview",
        "please_upload": "Please upload an image first",
        "generating": "Generating...",
        
        # 颜色选择器
        "color_picker": "Color Picker",
        "select_color": "Select Color:",
        "color_preview": "Color Preview",
        "complementary_color": "Complementary Color",
        "color_palette": "Color Palette",
        "monochromatic": "Monochromatic",
        "analogous": "Analogous",
        "triadic": "Triadic",
        "tetradic": "Tetradic",
        
        # 摄影参数计算器
        "exposure_calculator": "Exposure Value Calculator",
        "aperture": "Aperture (f/)",
        "shutter_speed": "Shutter Speed (sec)",
        "iso": "ISO Sensitivity",
        "calculate_ev": "Calculate EV",
        "exposure_value": "Exposure Value (EV):",
        "dof_calculator": "Depth of Field Calculator",
        "focal_length": "Focal Length (mm)",
        "focus_distance": "Focus Distance (m)",
        "sensor_size": "Sensor Size",
        "calculate_dof": "Calculate DOF",
        "dof_result": "Depth of Field Result",
        "near_limit": "Near Limit:",
        "far_limit": "Far Limit:",
        "total_dof": "Total DOF:",
        "hyperfocal": "Hyperfocal Distance:",
        
        # 延迟摄影计算器
        "timelapse_calculator": "Timelapse Calculator",
        "real_duration": "Real Event Duration",
        "hours": "Hours",
        "minutes": "Minutes",
        "real_duration_desc": "The actual length of time you plan to shoot",
        "video_duration": "Final Video Duration (seconds)",
        "video_duration_desc": "The playback duration of the final timelapse video",
        "fps": "Video Frame Rate (FPS)",
        "fps_desc": "Frames per second of the final video",
        "calculate_params": "Calculate Parameters",
        "calculation_result": "Calculation Result",
        "total_frames": "Required number of photos:",
        "interval_seconds": "Shooting interval:",
        "camera_settings": "Recommended camera settings:",
        "timelapse_tips": "Timelapse Shooting Tips",
        "stability": "Stability",
        "stability_desc": "Use a sturdy tripod, avoid any camera movement",
        "battery": "Battery Life",
        "battery_desc": "For long shoots, use external power or spare batteries",
        "storage": "Storage Space",
        "storage_desc": "Ensure enough memory card space to store all photos",
        "manual_settings": "Manual Settings",
        "manual_settings_desc": "Use manual mode (M) for shooting; fixed aperture, shutter, ISO (or auto ISO), avoid exposure flicker",
        "aperture_priority": "Aperture Priority",
        "aperture_priority_desc": "Aperture priority (A mode) shooting; auto ISO: suitable for scenes with gradual light changes (such as day to evening)",
        "focus": "Focus",
        "focus_desc": "Use manual focus to avoid auto-focus changes during shooting",
        "common_subjects": "Suggested Intervals for Common Subjects",
        "subject": "Subject",
        "suggested_interval": "Suggested Interval",
        "clouds": "Cloud Movement",
        "crowd": "Crowd Flow",
        "sunrise": "Sunrise/Sunset",
        "stars": "Star Trails",
        "flowers": "Flower Blooming",
        
        # 摄影天气查看
        "check_location_weather": "Check Location Weather",
        "location": "Location",
        "search": "Search",
        "use_current_location": "Use Current Location",
        "location_example": "Example: Beijing, Shanghai, Guangzhou",
        "date": "Date",
        "check_weather": "Check Weather",
        "photo_suggestions": "Photography Suggestions",
        "loading": "Loading...",
        "getting_weather": "Getting weather data...",
        "sunrise_time": "Sunrise Time",
        "sunset_time": "Sunset Time",
        "wind_speed": "Wind Speed",
        "humidity": "Humidity",
        "golden_hour": "Golden Hour",
        "morning": "Morning",
        "evening": "Evening",
        "blue_hour": "Blue Hour",
        "weather_forecast": "Weather Forecast",
        "hourly_forecast": "Hourly Forecast",
        "time": "Time",
        "temp": "Temp",
        "conditions": "Conditions",
        "morning_golden_hour": "Morning Golden Hour",
        "evening_golden_hour": "Evening Golden Hour",
        "to": "to",
        "weather_data_error": "Failed to get weather data, please check your network connection or try again later.",
        "future_weather_forecast": "Future Weather Forecast",
        "check_weather_first": "Please check the weather first to get forecast information",
        
        # 语言切换
        "language": "Language",
        "language_zh": "中文",
        "language_en": "English"
    }
}

# 获取翻译文本
def get_text(key, lang="zh"):
    """获取指定语言的翻译文本
    
    Args:
        key: 文本键名
        lang: 语言代码，默认为中文
        
    Returns:
        翻译后的文本，如果未找到则返回键名
    """
    if lang not in language_resources:
        lang = "zh"  # 默认使用中文
        
    return language_resources[lang].get(key, key)

# 获取工具分类翻译
def get_translated_categories(categories, lang="zh"):
    """获取翻译后的工具分类列表
    
    Args:
        categories: 原始分类列表
        lang: 语言代码
        
    Returns:
        翻译后的分类列表
    """
    translated = []
    for category in categories:
        # 复制原始分类对象
        translated_category = category.copy()
        # 翻译分类名称
        category_key = f"category_{category['id']}"
        translated_category["name"] = get_text(category_key, lang)
        translated.append(translated_category)
    return translated

# 获取工具列表翻译
def get_translated_tools(tools, lang="zh"):
    """获取翻译后的工具列表
    
    Args:
        tools: 原始工具列表
        lang: 语言代码
        
    Returns:
        翻译后的工具列表
    """
    translated = []
    for tool in tools:
        # 复制原始工具对象
        translated_tool = tool.copy()
        
        # 如果是文档工具，不进行翻译
        if tool.get("id", "").startswith("doc-"):
            translated.append(translated_tool)
            continue
            
        # 翻译工具名称和描述
        tool_id = tool.get("id", "")
        if tool_id:
            # 将连字符替换为下划线以匹配翻译键
            tool_key = f"tool_{tool_id.replace('-', '_')}"
            desc_key = f"desc_{tool_id.replace('-', '_')}"
            
            # 更新名称和描述
            if tool_key in language_resources[lang]:
                translated_tool["name"] = get_text(tool_key, lang)
            if desc_key in language_resources[lang]:
                translated_tool["description"] = get_text(desc_key, lang)
                
        translated.append(translated_tool)
        
    return translated